xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
  xml.channel do
    xml.title @novel.title
    xml.description @novel.summary
    xml.link request.url
	xml.language('en-us')
    xml.ttl('10')
    for fragment in @fragments
      xml.item do
        xml.title truncate(fragment.content,:length=>50)
        xml.description fragment.content
        xml.pubDate fragment.created_at.to_s(:rfc822)
        #make sure the RSS can work. The xml.link attribute is must and the url should be absolute. 
		#like "http://your host/fragment/show/1" is valid and "/fragment/show/1" is invalid.
		xml.link url_for(:controller=>"fragment", :action=>"show", :id=>fragment, :only_path=>false) #fragments_url(fragment, :rss)
        #more information see http://cyber.law.harvard.edu/rss/rss.html
		xml.guid url_for(:controller=>"fragment", :action=>"show", :id=>fragment, :only_path=>false)
      end
    end
  end
end
